package common.hua.com.mycontrolactivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.hua.common.BaseActivity;

import common.hua.com.myapplication.R;

public class MyControlHomeActivity extends BaseActivity implements OnClickListener {

    private Button mabiaoBt, yuanhuanBt, refreshBt, proBt, dragBt, roatingBt, chatBt,horchartBt;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.initViews();
        this.setPageTitle("自定义控件");
    }

    private void initViews() {
        this.setContentViewItem(R.layout.mainactivitylayout);
        this.mabiaoBt = (Button) this.findViewById(R.id.mabiao);
        this.yuanhuanBt = (Button) this.findViewById(R.id.yuanhuan);
        this.proBt = (Button) this.findViewById(R.id.pro);
        this.refreshBt = (Button) this.findViewById(R.id.refresh);
        this.dragBt = (Button) this.findViewById(R.id.drag);
        this.roatingBt = (Button) this.findViewById(R.id.rotating);
        this.chatBt = (Button) this.findViewById(R.id.chat);
        this.horchartBt= (Button) this.findViewById(R.id.horchat);


        this.mabiaoBt.setOnClickListener(this);
        this.yuanhuanBt.setOnClickListener(this);
        this.refreshBt.setOnClickListener(this);
        this.proBt.setOnClickListener(this);
        this.dragBt.setOnClickListener(this);
        this.roatingBt.setOnClickListener(this);
        this.chatBt.setOnClickListener(this);
        this.horchartBt.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        switch (v.getId()) {
            case R.id.mabiao:
                intent.setClass(this, ArcActivity.class);
                break;
            case R.id.yuanhuan:
                intent.setClass(this, RingControlActivity.class);
                break;
            case R.id.refresh:
                intent.setClass(this, RefreshActivity.class);
                break;
            case R.id.pro:
                intent.setClass(this, ProgressActivity.class);
                break;
            case R.id.drag:
                intent.setClass(this, DragControlActivity.class);
                break;
            case R.id.rotating:
                intent.setClass(this, RotatingPointerActivity.class);
                break;
            case R.id.chat:
                intent.setClass(this, TestChat.class);
                break;
            case R.id.horchat:
                intent.setClass(this, TestMyHorChart.class);
                break;
        }

        this.startActivity(intent);
    }
}
